#include <algorithm>
#include "BulletManager.h"

BulletManager::BulletManager(unsigned int const length)
    : _length(length), _next(0)
{
    unsigned int i;

    for (i = 0; i < _length; ++i)
        _bullets.push_back(new Bullet());
}

Bullet * BulletManager::getNext()
{
    Bullet * next = _bullets[_next];
    _next = (_next + 1) % _length;
    return next;
}
